home *** CD-ROM | disk | FTP | other *** search
Text File | 1998-02-08 | 2.6 KB | 75 lines | [TEXT/ToyS] |
- on SmallMenuItem(n, icn, aName)
- set x to 10 + (n - 1) mod 2 * 180
- set y to (n - 1) div 2 * 24 + 7
- return [{class:icon push button, bounds:[x, y, x + 22, y + 22], contents:icn, style:9}, ¬
- {class:static text, bounds:[x + 26, y + 3, x + 178, y + 19], contents:aName}]
- --{class:push button, bounds:[x + 26, y + 1, x + 150, y + 21], name:aName}]
- end SmallMenuItem
-
- on SmallChooseLayout()
- --try
- tell application "FileMaker Pro" to tell document 1
- set docName to name
- set layoutNames to name of every layout
- set layoutCount to layoutNames's length
- set theContents to []
- repeat with i from 1 to layoutCount
- set theContents to theContents & my SmallMenuItem(i, 128, layoutNames's item i)
- end repeat
-
- activate
- set n to dd auto dialog {style:standard window, has close box:true, default item:0, name:docName ¬
- , size:[380, 12 + 24 * ((layoutCount + 1) div 2)], contents:theContents} with fonts {style:32} with grayscale
- repeat with i from 1 to layoutCount * 2 by 2
- if n's item i then
- go to layout (layoutNames's item ((i + 1) div 2))
- exit repeat
- end if
- end repeat
- end tell
- (*on error
- beep
- end*)
- end SmallChooseLayout
-
- on BigMenuItem(n, icn, aName, aDesc)
- set y to n * 45 - 35
- return [{class:icon push button, bounds:[20, y, 20 + 40, y + 40], contents:icn, style:8}, ¬
- {class:static text, bounds:[70, y - 1, 320, y + 15], contents:aName, font:1}, ¬
- {class:static text, bounds:[70, y + 14, 320, y + 14 + 24], contents:aDesc}]
- end BigMenuItem
-
- on BigChooseLayout()
- --try
- set f to path to me
- tell application "FileMaker Pro" to tell document 1
- set [docName, layoutNames] to [name, name of every layout]
-
- set layoutCount to layoutNames's length
- if layoutCount > 6 then set layoutCount to 6
- set theContents to []
- repeat with i from 1 to layoutCount
- set theContents to theContents & my BigMenuItem(i, i * 1000, layoutNames's item i, ¬
- "Put description for layout “" & layoutNames's item i & "” of database “" & docName & "” here.")
- end repeat
-
- activate
- set rf to res open f with keep in chain -- If saved as an applet this will use the icons in its res fork
- set n to dd auto dialog {style:standard window, has close box:true, name:docName & " - Choose a Layout", size:[340 ¬
- , 15 + layoutCount * 45], contents:theContents} with fonts [null, null, {name:"Geneva", size:9, style:italic}] with grayscale
- res close rf
- repeat with i from 1 to layoutCount * 3 by 3
- if n's item i then
- go to layout (layoutNames's item ((i + 2) div 3))
- exit repeat
- end if
- end repeat
- end tell
- (*on error
- beep
- end try*)
- end BigChooseLayout
-
-
- SmallChooseLayout()
- BigChooseLayout()